home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
- DOCUMENTATION OF AUTOLISP COMMAND FUNCTIONS BY ROGER BROOKS
-
- 4880 Galley Rd. #228, Colorado Springs, CO 80915
-
-
-
-
-
- QTSW
-
- I like to have a special function key to toggle QTEXT mode.
- Since AutoCAD V2.18 does not provide a control character for this
- function as it does for other "toggle" functions, I wrote a
- simple command definition and defined an SFK as "QTSW ".
-
-
- BOX
-
- This appears to be faster and more conservative of space than
- the use of BLOCKs, which is how I used to draw rectangles. In
- this case I am able to simulate AutoCAD's handling of "point"
- default vs "string" options because (getpoint) will return nil
- if a string is entered instead of a point.
-
- Unfortunately, V2.18 provides no way to distinguish one string
- from another after a getpoint, hence the separate "CBOX" command.
- There is supposed to be a user-accessible lisp function (initget)
- in AutoCAD V2.6 which supports the full AutoCAD resident command
- style of selecting options by entering various strings in place
- of a default point.
-
-
- CBOX
-
- This would be the third option in BOX if I had access to the
- (initget) function as described above. Unfortunately, AutoCAD
- beyond V2.18 has not been ported to my machine, a NEC APC.
-
- You will note that this definition, like most described here,
- begins with (setvar "CMDECHO" 0) and ends with (quote Command:).
- The first makes the inner workings of the command function
- transparent to the user, while the second produces the best
- approximation of a new "Command:" prompt available under V2.18
- after execution of a lisp routine. It actually appears as:
-
- COMMAND:
- *
-
- where the * represents the text cursor position.
-
-
-
-
-
- BUBBLE
-
- Draws a numbered bubble with leader on layer 0. The shape
- "SQUIGGLE" (in my file CUSTOM.SHP) must be loaded for leaders
- to be drawn from the interior of objects. The trignometry is
- used to second-guess the DIM LEADER function in deciding if a
- horizontal "dog-leg" will be drawn on the end of the leader and
- if so, in what direction. This makes the use of OSNAP dangerous
- with horizontal leaders unless the bubbled end of the leader is
- specified by a horizontal displacement instead of by picking a
- point.
-
- The danger is that the line will appear to be horizontal without
- being exactly so, which can lead to a gap between bubble and
- leader. This may be fixed by introducing a tolerance in a future
- version. Meanwhile, the use of GRID SNAP is recommended to
- insure that leaders which appear horizontal really are.
-
-
- NOTES
-
- Undoubtedly the most useful of my AutoLISP routines, I wrote
- this in sheer desperation when it turned out that PDWORD had
- been compiled from Turbo PASCAL with IBM specific I/O code.
- As it turns out, NOTES has many advantages over PDWORD; notably,
- it is much smaller and requires no processing outside of AutoCAD
- except the creation of the text file.
-
- Please remember, however, when creating your text file, that
- (at least in V2.18) AutoCAD does not support the complete ASCII
- character set. I found the lack of a TAB character to be a
- particular problem and invented a crude approximation which
- will provide only the first TAB stop at roughly column 9. If
- anyone can figure out how to do a full set of TABs, I would
- love to hear about it.
-
- This function inserts text referred to an upper left corner but
- it can be easily expanded after the model of BOX above to include
- a second option if you frequently find yourself including large
- blocks of centered or right-justified text.
-
- The vertical line spacing is set to 60% of character height,
- which is within 3% of the default line spacing for all fonts
- supplied with AutoCAD V2.18. The reason for this is that the
- null command (command "") which is said in the documentation
- to perform like pressing RETURN from the keyboard, cannot be
- used within AutoLISP to repeat a command invoked with the
- (command) function. Instead, it repeats the last command
- entered from the keyboard, in this case, NOTES. Hence it is
- impossible (at least in V2.18) to use the "repeat last command"
- function to enter text on succeeding lines.
-